package com.yueyang.sojourn.server.model.dto;

import com.yueyang.sojourn.server.model.enums.BasicFacilityEnum;
import com.yueyang.sojourn.server.model.enums.CateringEnum;
import com.yueyang.sojourn.server.model.enums.RecreationEnum;
import com.yueyang.sojourn.server.validation.annotation.EnumValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author yemingxing
 * @summary 编辑项目信息 Dto
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-12
 */
@Data
@ApiModel("编辑项目信息DTO")
public class EditProjectDto {

    @ApiModelProperty(value = "项目id", required = true)
    @NotNull(message = "[项目id]不能为空")
    private Long id;

    /**
     * 项目名称
     */
    @ApiModelProperty(value = "项目名称")
    @Size(min = 4, max = 20, message = "[项目名称]限制4至20字")
    private String name;

    /**
     * 项目地址
     */
    @ApiModelProperty(value = "项目地址")
    @Valid
    private GeoLocationDto location;

    /**
     * 项目详情
     */
    @ApiModelProperty(value = "项目详情")
    @Size(max = 1000, message = "[项目详情]限制不超过1000字")
    private String detail;

    /**
     * 项目主图对应附件
     */
    @ApiModelProperty(value = "项目主图")
    @Valid
    private AttachDto homePic;

    /**
     * 项目其他图片集合
     */
    @ApiModelProperty(value = "项目图片")
    @Valid
    @Size(max = 50, message = "[项目图片]最多可上传50张图片")
    private List<AttachDto> othersPic;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    @Size(max = 20, message = "[联系电话]最大支持20字")
    private String tel;

    /**
     * 基础设施
     */
    @ApiModelProperty(value = "基础设施(枚举值)")
    @EnumValid(clazz = BasicFacilityEnum.class, message = "[基础设施]枚举值错误")
    private List<Integer> basicFacility;

    /**
     * 餐饮服务
     */
    @ApiModelProperty("餐饮服务(枚举值)")
    @EnumValid(clazz = CateringEnum.class, message = "[餐饮服务]枚举值错误")
    private List<Integer> catering;

    /**
     * 娱乐活动
     */
    @ApiModelProperty("娱乐活动(枚举值)")
    @EnumValid(clazz = RecreationEnum.class, message = "[娱乐活动]枚举值错误")
    private List<Integer> recreation;
}